import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {    //配置重定向
    path: "/",
    redirect: "/home"
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/collect',
    name: 'Collect',
    component: () => import('../views/Collect.vue')
  }, {
    path: '/mine',
    name: 'Mine',
    component: () => import('../views/Mine.vue')
  }, {
    path: '/detail/:id',
    name: 'Detail',
    component: () => import('../views/Detail.vue')

  }, {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  }, {
    path: '/zhuce',
    name: 'Zhuce',
    component: () => import('../views/Zhuce.vue')
  }

  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
